FROM golang:alpine AS builder

ENV CGO_ENABLED=0
ENV GOPROXY=https://goproxy.cn,direct
ENV sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

WORKDIR /build
ADD go.mod .
ADD go.sum .
ADD main.go .
RUN go build -o main

FROM scratch
WORKDIR /app
COPY --from=builder /build/main /app
CMD ["./main"]


# docker build -t  ginone:v1.0 .
# docker run -itd --name ginone -p 8888:8888 ginone:v1.0
# 访问 http://192.168.217.135:8888/